

import 'package:flutter/cupertino.dart';
import 'package:flutter_pleasure_video/config/application.dart';
import 'package:flutter_pleasure_video/constant/color.dart';
import 'package:flutter_pleasure_video/data/database/yck_rule_helper.dart';
import 'package:flutter_pleasure_video/data/model/yck_rule_model.dart';
import 'package:flutter_pleasure_video/route/route_config.dart';
import 'package:flutter_pleasure_video/route/router.dart';
import 'package:flutter_pleasure_video/widget/diglog/app_dialog.dart';
import 'package:flutter_pleasure_video/widget/diglog/common_dialog.dart';
import 'package:get/get.dart';
import 'package:flutter_pleasure_video/util/extensions/string_extensions.dart';

class VideoSourcePage extends StatefulWidget {
  @override
  _VideoSourcePageState createState() => _VideoSourcePageState();
}

class _VideoSourcePageState extends State<VideoSourcePage> with AutomaticKeepAliveClientMixin{

  @override
  bool get wantKeepAlive => true;



  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    super.build(context);
    return Container(
      color: AppColor.white,
      child: Column(
        children: [
          GestureDetector(
            onTap: (){
              // AppRouter.toScanQRCodePage((dynamic result){
              //   if(result is String) {
              //     sourceValueController.setValue(result);
              //   }else{
              //     AppDialog.showImportSourceDialog(context, result,onExitListener: (){
              //       sourceValueController.setValue("资源列表的数据：${Application.yckRuleModelMap.length}个");
              //       sourceValueController.setModelList();
              //     });
              //   }
              // });
            },
            child: Text("扫一扫"),
          ),
          //
          // Obx(
          //     ()=>Container(
          //       child: Text(sourceValueController.value.value),
          //     ),
          // ),
          // Expanded(child: SizedBox(
          //   child: Obx(
          //         ()=>ListView.builder(
          //       itemCount: sourceValueController.modelList.length,
          //       itemBuilder: (context,index){
          //         return GestureDetector(
          //           onTap: (){
          //             AppRouter.toSourceAnalyzePage((sourceValueController.modelList[index] as YckRuleModel));
          //           },
          //           onLongPress: (){
          //             _sourceLongPress((sourceValueController.modelList[index] as YckRuleModel));
          //           },
          //           child: Container(
          //             padding: EdgeInsets.symmetric(horizontal: 16,vertical: 8),
          //             child: Text((sourceValueController.modelList[index] as YckRuleModel).title),
          //           ),
          //         );
          //       },
          //     ),
          //   ),
          // )),
        ],
      ),
    );
  }

  //
  // _sourceLongPress(YckRuleModel model){
  //   AppDialog.showCommonDialog(
  //       context,
  //       title: "删除消息",
  //       info: "确认删除这个资源吗？",
  //       barrierDismissible: false,
  //       cancel: AppDialogButton("取消", () {
  //         "点了取消".print;
  //         return true;
  //       }),
  //       confirm: AppDialogButton("确定", () {
  //         Application.yckRuleModelMap.remove(model.id);
  //         sourceValueController.setModelList();
  //         YckRuleHelper.init().remove(model);
  //         return true;
  //       }));
  // }

}


